{extend name="common/base" /}

{block name="title"}<title>{$title}</title>{/block}

{block name="main"}
<div class="layui-fluid table">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    {$title}
                    {if (!empty($is_sync))}
                    <div class="layui-input-inline pull-right" style="margin-right: 10px;">
                        <a   class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary lay-event-sync" style="margin-top:6px;">
                            一键同步
                        </a>
                    </div>
                    {/if}

                    {if (!empty($create_url))}
                    <div class="layui-input-inline pull-right" style="margin-right: 10px;">
                        <a data-href="{$create_url}" data-title="新增" admin-event="formLayer" refresh="" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary" style="margin-top:6px;">
                            新增
                        </a>
                    </div>
                    {/if}

                </div>

                <div class="layui-card-body admin-table">
                    <!--//搜索框-->
                    <div class="layui-row admin-table-action">
                        <div class="layui-col-md12 search-form">
                            <div class="layui-form layui-form-pane search layui-row">
                                <div class="layui-form-item layui-row ">
                                    {include file="common/base_search" /}

                                    <button lay-filter="search" lay-submit="" class="layui-btn  layui-btn-sm layui-btn-radius layui-btn-primary search-submit">
                                        筛选
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <table id="table" lay-filter="table"></table>

                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="action"}
<script type="text/html" id="barDemo">
    {if (!empty($edit_url))}
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    {/if}
    {if (!empty($del_url))}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    {/if}
</script>
{/block}

<script>
{block name="param"}

    //初始化参数
    var cols = init_cols({$cols|json_encode|raw});
    var list_url = '{$list_url}';
    var edit_url = '{$edit_url?:""}';
    var del_url = '{$del_url?:""}';
    var update_url = '{$update_url?:""}';

{/block}

</script>